﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Microsoft.EntityFrameworkCore;

namespace backend.Models;

public partial class RepairRequest
{
    [Key]
    [Column("R_ID")]
    public int RId { get; set; }

    [Column("U_ID")]
    [StringLength(8)]
    [Unicode(false)]
    public string UId { get; set; } = null!;

    [Column("FC_ID")]
    [StringLength(8)]
    [Unicode(false)]
    public string FcId { get; set; } = null!;

    [Column("M_ID")]
    [StringLength(8)]
    [Unicode(false)]
    public string? MId { get; set; }

    [Column("F_ID")]
    [StringLength(8)]
    [Unicode(false)]
    public string FId { get; set; } = null!;

    [Column("R_Time", TypeName = "datetime")]
    public DateTime RTime { get; set; }

    [Column("R_Description")]
    [StringLength(1024)]
    public string RDescription { get; set; } = null!;

    [Column("R_Picture")]
    [StringLength(64)]
    [Unicode(false)]
    public string? RPicture { get; set; }

    [Column("R_Location")]
    [StringLength(64)]
    public string RLocation { get; set; } = null!;

    [Column("R_ConvenientTime", TypeName = "datetime")]
    public DateTime? RConvenientTime { get; set; }

    [Column("R_StartTime", TypeName = "datetime")]
    public DateTime? RStartTime { get; set; }

    [Column("R_EndTime", TypeName = "datetime")]
    public DateTime? REndTime { get; set; }

    [Column("R_Record")]
    [StringLength(512)]
    public string? RRecord { get; set; }

    [Column("R_State")]
    [StringLength(16)]
    public string RState { get; set; } = null!;

    [Column("R_Evaluate")]
    [StringLength(256)]
    public string? REvaluate { get; set; }

    [Column("R_ResponseTime", TypeName = "decimal(3, 1)")]
    public decimal? RResponseTime { get; set; }

    [Column("R_Quality", TypeName = "decimal(3, 1)")]
    public decimal? RQuality { get; set; }

    [Column("R_Attitude", TypeName = "decimal(3, 1)")]
    public decimal? RAttitude { get; set; }

    [ForeignKey("FId")]
    [InverseProperty("RepairRequests")]
    public virtual Failure FIdNavigation { get; set; } = null!;

    [ForeignKey("FcId")]
    [InverseProperty("RepairRequests")]
    public virtual FirstClass Fc { get; set; } = null!;

    [ForeignKey("MId")]
    [InverseProperty("RepairRequests")]
    public virtual MaintenanceMan? MIdNavigation { get; set; }

    [ForeignKey("UId")]
    [InverseProperty("RepairRequests")]
    public virtual User UIdNavigation { get; set; } = null!;
}
